YES 1.09 H-Termination proof of /home/matraf/haskell/eval_FullyBlown_Fast/Monad.hs
H-Termination of the given Haskell-Program with start terms could successfully be proven:



HASKELL
  ↳ LR

mainModule Monad
  ((replicateM :: Int  ->  [a ->  [[a]]) :: Int  ->  [a ->  [[a]])

module Monad where
  import qualified Maybe
import qualified Prelude

  replicateM :: Monad b => Int  ->  b a  ->  b [a]
replicateM n x sequence (replicate n x)


module Maybe where
  import qualified Monad
import qualified Prelude



Lambda Reductions:
The following Lambda expression
\xsreturn (x : xs)

is transformed to
sequence0 x xs = return (x : xs)

The following Lambda expression
\xsequence cs >>= sequence0 x

is transformed to
sequence1 cs x = sequence cs >>= sequence0 x



↳ HASKELL
  ↳ LR
HASKELL
      ↳ BR

mainModule Monad
  ((replicateM :: Int  ->  [a ->  [[a]]) :: Int  ->  [a ->  [[a]])

module Maybe where
  import qualified Monad
import qualified Prelude


module Monad where
  import qualified Maybe
import qualified Prelude

  replicateM :: Monad a => Int  ->  a b  ->  a [b]
replicateM n x sequence (replicate n x)



Replaced joker patterns by fresh variables and removed binding patterns.

↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ BR
HASKELL
          ↳ COR

mainModule Monad
  ((replicateM :: Int  ->  [a ->  [[a]]) :: Int  ->  [a ->  [[a]])

module Monad where
  import qualified Maybe
import qualified Prelude

  replicateM :: Monad a => Int  ->  a b  ->  a [b]
replicateM n x sequence (replicate n x)


module Maybe where
  import qualified Monad
import qualified Prelude



Cond Reductions:
The following Function with conditions
undefined 
 | False
 = undefined

is transformed to
undefined  = undefined1

undefined0 True = undefined

undefined1  = undefined0 False

The following Function with conditions
take n vx
 | n <= 0
 = []
take vy [] = []
take n (x : xs) = x : take (n - 1) xs

is transformed to
take n vx = take3 n vx
take vy [] = take1 vy []
take n (x : xs) = take0 n (x : xs)

take0 n (x : xs) = x : take (n - 1) xs

take1 vy [] = []
take1 ww wx = take0 ww wx

take2 n vx True = []
take2 n vx False = take1 n vx

take3 n vx = take2 n vx (n <= 0)
take3 wy wz = take1 wy wz



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
HASKELL
              ↳ LetRed

mainModule Monad
  ((replicateM :: Int  ->  [a ->  [[a]]) :: Int  ->  [a ->  [[a]])

module Maybe where
  import qualified Monad
import qualified Prelude


module Monad where
  import qualified Maybe
import qualified Prelude

  replicateM :: Monad b => Int  ->  b a  ->  b [a]
replicateM n x sequence (replicate n x)



Let/Where Reductions:
The bindings of the following Let/Where expression
xs
where 
xs  = x : xs

are unpacked to the following functions on top level
repeatXs xu = xu : repeatXs xu



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
            ↳ HASKELL
              ↳ LetRed
HASKELL
                  ↳ NumRed

mainModule Monad
  ((replicateM :: Int  ->  [a ->  [[a]]) :: Int  ->  [a ->  [[a]])

module Monad where
  import qualified Maybe
import qualified Prelude

  replicateM :: Monad a => Int  ->  a b  ->  a [b]
replicateM n x sequence (replicate n x)


module Maybe where
  import qualified Monad
import qualified Prelude



Num Reduction: All numbers are transformed to thier corresponding representation with Pos, Neg, Succ and Zero.

↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
            ↳ HASKELL
              ↳ LetRed
                ↳ HASKELL
                  ↳ NumRed
HASKELL
                      ↳ Narrow

mainModule Monad
  (replicateM :: Int  ->  [a ->  [[a]])

module Maybe where
  import qualified Monad
import qualified Prelude


module Monad where
  import qualified Maybe
import qualified Prelude

  replicateM :: Monad a => Int  ->  a b  ->  a [b]
replicateM n x sequence (replicate n x)



Haskell To QDPs


↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
            ↳ HASKELL
              ↳ LetRed
                ↳ HASKELL
                  ↳ NumRed
                    ↳ HASKELL
                      ↳ Narrow
                        ↳ AND
QDP
                            ↳ QDPSizeChangeProof
                          ↳ QDP
                          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

new_psPs(:(xv110, xv111), xv8, h) → new_psPs(xv111, xv8, h)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
            ↳ HASKELL
              ↳ LetRed
                ↳ HASKELL
                  ↳ NumRed
                    ↳ HASKELL
                      ↳ Narrow
                        ↳ AND
                          ↳ QDP
QDP
                            ↳ QDPSizeChangeProof
                          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

new_gtGtEs(:(xv1010, xv1011), xv410, h) → new_gtGtEs(xv1011, xv410, h)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ BR
        ↳ HASKELL
          ↳ COR
            ↳ HASKELL
              ↳ LetRed
                ↳ HASKELL
                  ↳ NumRed
                    ↳ HASKELL
                      ↳ Narrow
                        ↳ AND
                          ↳ QDP
                          ↳ QDP
QDP
                            ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

new_sequence0(xv300, :(xv40, xv41), h) → new_gtGtEs0(xv41, xv300, xv40, xv41, h)
new_gtGtEs0(:(xv130, xv131), xv14, xv15, xv16, ba) → new_sequence(xv14, xv15, xv16, ba)
new_sequence(Succ(xv3000), xv40, xv41, h) → new_sequence0(xv3000, :(xv40, xv41), h)
new_gtGtEs0(:(xv130, xv131), xv14, xv15, xv16, ba) → new_gtGtEs0(xv131, xv14, xv15, xv16, ba)
new_sequence0(Succ(xv3000), :(xv40, xv41), h) → new_sequence0(xv3000, :(xv40, xv41), h)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: